package com.hiedu.service.impl;

import com.hiedu.beans.vo.OrderVO;
import com.hiedu.mapper.OrderMapper;
import com.hiedu.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ProjectName: hi-app
 * @Titile: OrderServiceImpl
 * @Author: 86180
 * @Description: TODO
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public List<OrderVO> getOrderList(Integer userId) {
        // todo 根据用户编号查询用户，判断用户是否存在
        List<OrderVO> orderVOList = orderMapper.getOrderByUserId(userId);
//            if(orderVOList==null || orderVOList.size()==0)
//                {
//                    throw new RuntimeException("该用户没有订单");
//                 }
        return orderVOList;
    }
}
